package com.detect.common.context;

import lombok.Data;

public class BaseContext {

    public static ThreadLocal<BaseUser> threadLocal = new ThreadLocal<>();

    public static void setCurrentBaseUser(BaseUser user) {
        threadLocal.set(user);
    }

    public static BaseUser getCurrentBaseUser() {
        return threadLocal.get();
    }

    public static void removeCurrentBaseUser() {
        threadLocal.remove();
    }

    @Data
    public static class BaseUser {
        private Long id;
        private String name;
    }
}
